<!-- 继承公共的 form -->
{{extend name="../../../module/view/form_table/form" /}}

<!-- 扩展 -->
{{block name="form_extend"}}
    <!-- 取货弹窗 -->
    <div class="am-modal am-radius" tabindex="-1" id="order-take-modal">
        <div class="am-modal-dialog am-radius am-nbfc">
            <div class="am-modal-hd">
                <span>{{:MyLang('order.form_item_take')}}</span>
                <a href="javascript: void(0)" class="am-close" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd">
                <div class="am-padding-sm">
                    <form class="am-form form-validation-take am-form-popup-fixed" method="post" action="{{:MyUrl('admin/order/delivery')}}" request-type="ajax-reload">
                        <div class="am-form-group am-form-group-refreshing am-margin-bottom-0">
                            <div class="am-form-icon am-nbfc">
                                <i class="am-icon-camera common-scan-submit" data-back-fun="OrderTakeScanBackHandle"></i>
                                <input type="text" autocomplete="off" name="extraction_code" placeholder="{{:MyLang('order.form_item_take_message')}}" minlength="4" maxlength="4" data-validation-message="{{:MyLang('order.form_item_take_message')}}" class="am-radius am-form-field" required />
                            </div>
                        </div>
                        <div class="am-form-popup-submit">
                            <input type="hidden" name="id" value="0" />
                            <input type="hidden" name="user_id" value="0" />
                            <button type="button" class="am-btn am-btn-warning am-radius am-btn-xs am-margin-right-lg" data-am-modal-close>
                                <i class="am-icon-paint-brush"></i>
                                <span>{{:MyLang('cancel_title')}}</span>
                            </button>
                            <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('confirm_title')}}'}">
                                <i class="am-icon-check"></i>
                                <span>{{:MyLang('confirm_title')}}</span>
                            </button>
                        </div>
                    </form>
                    <script type="text/javascript">
                        // 扫码回调
                        function OrderTakeScanBackHandle(value)
                        {
                            $('form.form-validation-take input[name="extraction_code"]').val(value);
                            $('form.form-validation-take').find('button[type="submit"]').trigger('click');
                        }
                    </script>
                </div>
            </div>
        </div>
    </div>

    <!-- 支付弹窗 -->
    <div class="am-popup am-radius" id="order-pay-popup">
        <div class="am-popup-inner">
            <div class="am-popup-hd">
                <h4 class="am-popup-title">{{:MyLang('order.form_payment_title')}}</h4>
                <span data-am-modal-close class="am-close">&times;</span>
            </div>
            <div class="am-popup-bd">
                <form class="am-form form-validation-pay am-form-popup-fixed" action="{{:MyUrl('admin/order/pay')}}" method="POST" request-type="ajax-reload">
                    <div class="business-list business-list-nbfc">
                        {{if !empty($buy_payment_list)}}
                            <ul class="am-avg-sm-2 am-avg-md-3 payment-list" data-type="payment">
                                {{foreach $buy_payment_list as $payment}}
                                    <li class="am-padding-sm" data-value="{{$payment.id}}">
                                        <div class="business-item am-nbfc am-padding-sm am-radius">
                                            {{if !empty($payment.logo)}}
                                                <img src="{{$payment.logo}}" class="am-radius" />
                                            {{/if}}
                                            <span>{{$payment.name}}</span>
                                            <i class="iconfont icon-subscript"></i>
                                        </div>
                                    </li>
                                {{/foreach}}
                            </ul>
                        {{else /}}
                            {{:ModuleInclude('public/not_data')}}
                        {{/if}}
                    </div>
                    <div class="am-form-popup-submit">
                        <input type="hidden" name="id" value="0" />
                        <input type="hidden" name="payment_id" value="0" />
                        <button type="button" class="am-btn am-btn-warning am-radius am-btn-xs am-margin-right-lg" data-am-modal-close>
                            <i class="am-icon-paint-brush"></i>
                            <span>{{:MyLang('cancel_title')}}</span>
                        </button>
                        <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('confirm_title')}}'}">
                            <i class="am-icon-check"></i>
                            <span>{{:MyLang('confirm_title')}}</span>
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
{{/block}}